/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author VietTien
 */
@Entity
@Table(name = "EventInfo")
@NamedQueries({
    @NamedQuery(name = "EventInfo.findAll", query = "SELECT e FROM EventInfo e"),
    @NamedQuery(name = "EventInfo.findByEventID", query = "SELECT e FROM EventInfo e WHERE e.eventID = :eventID"),
    @NamedQuery(name = "EventInfo.findByEventName", query = "SELECT e FROM EventInfo e WHERE e.eventName = :eventName"),
    @NamedQuery(name = "EventInfo.findByImageEvent", query = "SELECT e FROM EventInfo e WHERE e.imageEvent = :imageEvent"),
    @NamedQuery(name = "EventInfo.findByEventTitle", query = "SELECT e FROM EventInfo e WHERE e.eventTitle = :eventTitle"),
    @NamedQuery(name = "EventInfo.findByDescriptionEvent", query = "SELECT e FROM EventInfo e WHERE e.descriptionEvent = :descriptionEvent"),
    @NamedQuery(name = "EventInfo.findByMinPlayer", query = "SELECT e FROM EventInfo e WHERE e.minPlayer = :minPlayer"),
    @NamedQuery(name = "EventInfo.findByMaxPlayer", query = "SELECT e FROM EventInfo e WHERE e.maxPlayer = :maxPlayer"),
    @NamedQuery(name = "EventInfo.findByStartEvent", query = "SELECT e FROM EventInfo e WHERE e.startEvent = :startEvent"),
    @NamedQuery(name = "EventInfo.findByFinishEvent", query = "SELECT e FROM EventInfo e WHERE e.finishEvent = :finishEvent"),
    @NamedQuery(name = "EventInfo.findByStartReg", query = "SELECT e FROM EventInfo e WHERE e.startReg = :startReg"),
    @NamedQuery(name = "EventInfo.findByEndReg", query = "SELECT e FROM EventInfo e WHERE e.endReg = :endReg"),
    @NamedQuery(name = "EventInfo.findByIsDelete", query = "SELECT e FROM EventInfo e WHERE e.isDelete = :isDelete")})
public class EventInfo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "EventID")
    private Integer eventID;
    @Basic(optional = false)
    @Column(name = "EventName")
    private String eventName;
    @Basic(optional = false)
    @Column(name = "ImageEvent")
    private String imageEvent;
    @Basic(optional = false)
    @Column(name = "EventTitle")
    private String eventTitle;
    @Basic(optional = false)
    @Column(name = "DescriptionEvent")
    private String descriptionEvent;
    @Basic(optional = false)
    @Column(name = "MinPlayer")
    private int minPlayer;
    @Basic(optional = false)
    @Column(name = "MaxPlayer")
    private int maxPlayer;
    @Basic(optional = false)
    @Column(name = "StartEvent")
    @Temporal(TemporalType.TIMESTAMP)
    private Date startEvent;
    @Basic(optional = false)
    @Column(name = "FinishEvent")
    @Temporal(TemporalType.TIMESTAMP)
    private Date finishEvent;
    @Basic(optional = false)
    @Column(name = "StartReg")
    @Temporal(TemporalType.TIMESTAMP)
    private Date startReg;
    @Basic(optional = false)
    @Column(name = "EndReg")
    @Temporal(TemporalType.TIMESTAMP)
    private Date endReg;
    @Basic(optional = false)
    @Column(name = "isDelete")
    private boolean isDelete;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "eventInfo")
    private Collection<Registration> registrationCollection;

    public EventInfo() {
    }

    public EventInfo(Integer eventID) {
        this.eventID = eventID;
    }

    public EventInfo(Integer eventID, String eventName, String imageEvent, String eventTitle, String descriptionEvent, int minPlayer, int maxPlayer, Date startEvent, Date finishEvent, Date startReg, Date endReg, boolean isDelete) {
        this.eventID = eventID;
        this.eventName = eventName;
        this.imageEvent = imageEvent;
        this.eventTitle = eventTitle;
        this.descriptionEvent = descriptionEvent;
        this.minPlayer = minPlayer;
        this.maxPlayer = maxPlayer;
        this.startEvent = startEvent;
        this.finishEvent = finishEvent;
        this.startReg = startReg;
        this.endReg = endReg;
        this.isDelete = isDelete;
    }

    public Integer getEventID() {
        return eventID;
    }

    public void setEventID(Integer eventID) {
        this.eventID = eventID;
    }

    public String getEventName() {
        return eventName;
    }

    public void setEventName(String eventName) {
        this.eventName = eventName;
    }

    public String getImageEvent() {
        return imageEvent;
    }

    public void setImageEvent(String imageEvent) {
        this.imageEvent = imageEvent;
    }

    public String getEventTitle() {
        return eventTitle;
    }

    public void setEventTitle(String eventTitle) {
        this.eventTitle = eventTitle;
    }

    public String getDescriptionEvent() {
        return descriptionEvent;
    }

    public void setDescriptionEvent(String descriptionEvent) {
        this.descriptionEvent = descriptionEvent;
    }

    public int getMinPlayer() {
        return minPlayer;
    }

    public void setMinPlayer(int minPlayer) {
        this.minPlayer = minPlayer;
    }

    public int getMaxPlayer() {
        return maxPlayer;
    }

    public void setMaxPlayer(int maxPlayer) {
        this.maxPlayer = maxPlayer;
    }

    public Date getStartEvent() {
        return startEvent;
    }

    public void setStartEvent(Date startEvent) {
        this.startEvent = startEvent;
    }

    public Date getFinishEvent() {
        return finishEvent;
    }

    public void setFinishEvent(Date finishEvent) {
        this.finishEvent = finishEvent;
    }

    public Date getStartReg() {
        return startReg;
    }

    public void setStartReg(Date startReg) {
        this.startReg = startReg;
    }

    public Date getEndReg() {
        return endReg;
    }

    public void setEndReg(Date endReg) {
        this.endReg = endReg;
    }

    public boolean getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(boolean isDelete) {
        this.isDelete = isDelete;
    }

    public Collection<Registration> getRegistrationCollection() {
        return registrationCollection;
    }

    public void setRegistrationCollection(Collection<Registration> registrationCollection) {
        this.registrationCollection = registrationCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (eventID != null ? eventID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EventInfo)) {
            return false;
        }
        EventInfo other = (EventInfo) object;
        if ((this.eventID == null && other.eventID != null) || (this.eventID != null && !this.eventID.equals(other.eventID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.EventInfo[eventID=" + eventID + "]";
    }

}
